# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=ncftp
pkgver=3.2.6
pkgrel=6
pkgdesc="A set of free application programs implementing FTP"
url="https://www.ncftp.com/"
arch="all"
options="!check"  # No test suite.
license="ClArtistic"
makedepends="ncurses-dev"
subpackages="$pkgname-doc $pkgname-bookmarks $pkgname-dev"
source="https://dev.alpinelinux.org/archive/ncftp/ncftp-$pkgver-src.tar.xz
	gcc-10.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man

	cd "$builddir"/libncftp
	make shared
	cd "$builddir"
	make
}

package() {
	cd "$builddir"/libncftp
	make PREFIX="$pkgdir"/usr soinstall
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -D doc/LICENSE.txt \
		"$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

bookmarks() {
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ncftpbookmarks \
		"$subpkgdir"/usr/bin/
}

sha512sums="8e6091ce2ea1eb463edea322d1b5dde813475fd22096d67f0bfd2f5101ae09747ff25d38816d0b9b1077e6a5a256078361691f816aa2eefa38638aa523b4b382  ncftp-3.2.6-src.tar.xz
b0225946f66d21e870216ce19ee229eaceb0b44179af9a16237e41de48bb9344f807829ab3229e96e8a4e39e914d4ac581da377d0239af96775e618372c61084  gcc-10.patch"
